cmake_minimum_required(VERSION 3.8)

project(rk_demo)

add_definitions(-g -D__EXPORTED_HEADERS__)

set(SDK_PATH /mnt/e/project/os)
set(CMAKE_SYSROOT ${SDK_PATH}/buildroot/output/rockchip_rk3506/host/arm-buildroot-linux-gnueabihf/sysroot)
set(CMAKE_C_COMPILER ${SDK_PATH}/buildroot/output/rockchip_rk3506/host/bin/arm-buildroot-linux-gnueabihf-gcc)

add_definitions(-g -D__EXPORTED_HEADERS__  -Wno-incompatible-pointer-types)

include_directories(
	${PROJECT_SOURCE_DIR}/./
	${PROJECT_SOURCE_DIR}/lvgl8/
	${PROJECT_SOURCE_DIR}/home/
    ${PROJECT_SOURCE_DIR}/common/
    ${CMAKE_SYSROOT}/usr/include/rkadk/
    ${CMAKE_SYSROOT}/usr/include/lvgl/
    ${CMAKE_SYSROOT}/usr/include/lvgl/lv_drivers/
    ${CMAKE_SYSROOT}/usr/include/rockchip/
)

add_definitions(-DUSE_MOUSE=1 -DUSE_EVDEV=1 -DUSE_RKADK=1 -DDEBUG=1 -DUSE_KEY=1)
link_directories(${CMAKE_SYSROOT}/usr/lib)

aux_source_directory(${PROJECT_SOURCE_DIR}/sys SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/common SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/home SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/lvgl8 SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/. SRCS)

add_library(mouse_cursor_icon OBJECT ${PROJECT_SOURCE_DIR}/mouse_cursor_icon.c)

add_executable(${PROJECT_NAME} ${SRCS})

target_link_libraries(${PROJECT_NAME} lvgl pthread m lv_drivers freetype evdev rkadk)
